package test.thread;

/**
 * Created with IntelliJ IDEA.
 * User: leep
 * Date: 14-9-11
 * Time: 下午5:23
 * To change this template use File | Settings | File Templates.
 */
public class SimpleThread extends Thread {
	public static void main(String[] args) {
		for (int i = 0; i < 5; i++) {
			new SimpleThread().run();
		}
	}

	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			String name = this.getName();
			System.out.println(name + "--" + i);
			try {
				if (name.equals("Thread-0"))
					Thread.sleep(100);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
		}
	}
}
